package spring.boot.client.handler.heartbeat;

import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import spring.boot.client.dispatcher.MessageHandler;
import spring.boot.client.message.heartbeat.HeartbeatResponse;

@Slf4j
@Component
public class HeartbeatResponseHandler implements MessageHandler<HeartbeatResponse> {

    @Override
    public void execute(Channel channel, HeartbeatResponse message) {
        log.debug("Netty客户端收到服务端[{}]的心跳响应,num=[{}]", channel.id(), message.getNum());
    }

    @Override
    public String getType() {
        return HeartbeatResponse.TYPE;
    }

}
